<!--#
 @version 0.3 (auto-set)
#-->

<script language="javascript">
$(function () {
        $("a.show-hide-link").click(function() {
                var id = $(this).data('id');//'#sub' + 
                //$(id).toggle();

  if ($('#sub'+id).is(":visible")) {
   $('#sub'+id).hide();
   $('#link'+id).html(' + ');
   $.cookie("commands_item"+id, null);
  } else {
   $.cookie("commands_item"+id, "1");
   $('#sub'+id).show();
   $('#link'+id).html(' - ');
  }
  return false;


        });
});
</script>

<h3><#LANG_MODULE_CONTROL_MENU#></h3>
<a href="?view_mode=edit_commands" class="btn btn-success"><i class="icon-white icon-plus-sign"></i> <#LANG_ADD_NEW_SECTION#></a>

<!-- results -->
[#if RESULT#]
<!-- search results (list) -->
<form action="?" method="post" name="frmList_commands">
<table class="table table-bordered">
[#begin RESULT#]
<tr>
 <td>
   [#if RESULT#]
   <a href="#" id="link[#ID#]" class="show-hide-link btn btn-mini expand" data-id="[#ID#]"> + </a>
   [#endif#]
   [#if ICON!=""#]<img src="/cms/icons/[#ICON#]" class="action-list-icon" align="absmiddle">[#endif#]
   <a href="?view_mode=edit_commands&id=[#ID#]">[#TITLE#]</a>
   <span class="divider">/</span>
   [#if TYPE!=""#][#TYPE#]<span class="divider">/</span>[#endif TYPE#]
  [#PRIORITY#]
 </td>
 <td class="command-actions">
  [#if EXT_ID="0"#]
  <a href="?view_mode=edit_commands&parent_id=[#ID#]"><#LANG_EXPAND#></a>
  [#endif EXT_ID#]
  [#if !RESULT#]
    <a href="?view_mode=delete_commands&id=[#ID#]" onClick="return confirm('<#LANG_ARE_YOU_SURE#>')"><#LANG_DELETE#></a>
  [#endif RESULT#]
</tr>
[#if RESULT#]
 <tr><td colspan=2>
  <div id="sub[#ID#]" style="display:none">
  <table class="table table-bordered table-inner">
   [#tree RESULT#]
  </table>
  </div>
 </td>
 </tr>
[#endif RESULT#]
[#end RESULT#]
</table>
<input type="hidden" name="data_source" value="<#DATA_SOURCE#>">
<input type="hidden" name="view_mode" value="multiple_commands">
</form>

<script language="javascript">
[#begin RESULT#]
 if ($.cookie("commands_item[#ID#]")) {
  $('#sub[#ID#]').show();
  $('#link[#ID#]').html(' - ');
 }
 [#if RESULT#]
 [#tree RESULT#]
 [#endif RESULT#]
[#end RESULT#]
</script>

<!-- / search results (list) -->
[#else RESULT#]
<div class="alert alert-error">
<#LANG_NO_RECORDS_FOUND#>
</div>
[#endif RESULT#]
<!-- / results -->
